package com.xc.h05.service.lishenao.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xc.h05.entity.Heartknowledge;
import com.xc.h05.mapper.HeartknowledgeMapper;
import com.xc.h05.service.lishenao.HeartknowledgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class HeartknowledgeServiceImpl implements HeartknowledgeService {

    @Autowired
    private HeartknowledgeMapper heartknowledgeMapper;
    @Override
    public PageInfo<Heartknowledge> selectAll(Integer pageNum, Integer pageSize, Heartknowledge heartknowledge) {
        PageHelper.startPage(pageNum,pageSize);
        List<Heartknowledge> list = heartknowledgeMapper.selectAll(heartknowledge);
        PageInfo<Heartknowledge> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public int deleteByPrimaryKey(Long id) {
        return heartknowledgeMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Heartknowledge record) {
        return heartknowledgeMapper.insert(record);
    }

    @Override
    public int updateByPrimaryKeySelective(Heartknowledge record) {
        return heartknowledgeMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public Heartknowledge selectByPrimaryKey(Long id) {
        return heartknowledgeMapper.selectByPrimaryKey(id);
    }
}
